package kr.hkit.powerjava.chapter26.Young;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.Properties;
import java.util.Scanner;

import kr.hkit.powerjava.chapter26.common.DbUtil;


public class TestMainChu {
	public static void main(String[] args) {
		
		Connection connection = ConnectionFactory.getConnection();
		Scanner sc = new Scanner(System.in);
		
		AbsSerivce<Department> deptSvc = new DepartmentService(sc, connection);
		deptSvc.prnMenu();
		
		DbUtil.close(connection);
		
		
		/*//테스트용
		
		Connection connection = ConnectionFactory.getConnection();
		System.out.println(connection);
		DepartmentDAO dao = new DepartmentDAO(connection);	
		
		try {
			dao.insertItem(new Department(10, "물류", 20));
			System.out.println("삽입성공");
		} catch (SQLException e) {
			System.err.println(e.getMessage() + e.getErrorCode());
		}
		*/
		
		
		

	/*
		// 파일값 저장하기 OK!
		// 설정값 셋팅했으니 값 집어넣어야죠
		String driver = "com.mysql.jdbc.Driver";
		String url = "jdbc:mysql://localhost:3306/mysql_study";
		String user = "root";
		String password = "1111";

		DBProperties.saveProroperties("dbcon1.xml", driver, url, user, password);

		//테스트용 
		Properties prop = DBProperties.loadProperties("dbcon1.xml");
		System.out.println(prop); 
		
		*/
		
		/*
		//password로 하니까 연결됐음... 
		Connection con = ConnectionFactory.getConnection();
		System.out.println(con);
		 */
		
	}
}

